<template>
  <div  @click="btn" :class='{"primary" :type=="primary",
  "danger" :type=="danger"
  }'>
    <slot></slot>
  </div>
</template>

<script>
export default {
     methods:{
        btn(){
            console.log(this.url);
            this.$emit('fn',this.url,this.newsid)
        }
    },
    props:{
        type:String,
        url:String,
        newsid:String,
    }
};

</script>

<style scoped>
    div{
        height: 48px;
        width: 318px;
        border-radius: 24px;
        background: rgb(139, 139, 139);
        color: #666;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        margin:20px auto
    }
    .primary{
        background-color: rgb(219, 134, 5);
        color: #fff;
    }
    .danger{
        background-color: #CC3300ed;
        color: #fff;
    }
</style>